<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul class="list">
        <li>item1</li>
        <li>item2</li>
        <li>item3</li>
        <li>item4</li>
        <li>item5</li>
        <li>item6</li>
    </ul>

    <script>
        //dom节点
        //文本节点
        // 属性节点

        var list=document.querySelector('.list')

        // console.log(list)
        console.log(list.childNodes)
        // console.log(list.children)

        // console.log(list.firstChild)
        // console.log(list.lastChild)
        // console.log(list.children[0])
        // console.log(list.children[list.children.length-1])

        console.log(list.children[0].parentNode)

        console.log(list.children[0].nextSibling.nextSibling)//会包含text节点
        console.log(list.children[0].nextElementSibling)//不会包含text节点

        console.log(list.children[3])
        console.log(list.children[3].previousSibling)
        console.log(list.children[3].previousElementSibling)

        
    </script>
</body>
</html>